import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

public class test {
    public static void main(String[] args) throws ParseException {
//        SimpleDateFormat format = new SimpleDateFormat("yyyyMM");
//        Date date = new Date();
//        Calendar calendar = Calendar.getInstance();
//        calendar.setTime(date); // 设置为当前时间
//        calendar.set(Calendar.MONTH, calendar.get(Calendar.MONTH) - 1); // 设置为上一个月
//        date = calendar.getTime();
//        String accDate = format.format(date);
//        System.out.println("accDate:" + accDate);
//        String bz = "n99999";
//        bz = bz.substring(0, bz.indexOf("9"));
//        System.out.println("bz:" + bz);
//        String loanDate = "20170825";
//        SimpleDateFormat df=new SimpleDateFormat("yyyyMMdd");
//        SimpleDateFormat df1=new SimpleDateFormat("yyyy-MM-dd");
//        Date loanDate1=df.parse(loanDate);
//        String date1=df1.format(loanDate1);
//        System.out.println("date1:"+date1);
//
//        String sheetName="孙明洋";
//        String xm="";
//        //截取借款人名字
//        if(sheetName.contains("借款")){
//           xm=sheetName.substring(0, sheetName.indexOf("借款"));
//        }else{
//           xm=sheetName;
//        }

        //System.out.println("xm:"+xm);

//        SimpleDateFormat format = new SimpleDateFormat("yyyyMM");
//        Date date = new Date();
//        Calendar calendar = Calendar.getInstance();
//        calendar.setTime(date); // 设置为当前时间
//       // calendar.set(Calendar.MONTH, calendar.get(Calendar.MONTH) - 1); // 设置为上一个月
//        calendar.add(Calendar.MONTH, -1);
//        date = calendar.getTime();
//        String accDate = format.format(date);
//        System.out.println("accDate:"+accDate);
//        System.out.println(UUIDUtils.getId());

        Calendar ca = Calendar.getInstance();//得到一个Calendar的实例
        ca.setTime(new Date());
        ca.add(Calendar.DATE, -10);
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");//小写的mm表示的是分钟
        String substring = sdf.format(ca.getTime());
        System.out.println("substring:"+substring);

        String str="王伟强#622700220408113939";
//        str=str.substring(0,8);
//        System.out.println("str:"+str);
       String str3= str.split("[#]")[0];
       String str4= str.split("[#]")[1];
        String str1=str.substring(0, str.indexOf("#"));
        String str2=str.substring(str1.length()+1);
        System.out.println("str1:"+str1);
        System.out.println("str2:"+str2);
        System.out.println("str3:"+str3);
        System.out.println("str4:"+str4);
        String content="20200701-20200708";
        String beginTime = content.split("[-]")[0];
        String endTime = content.split("[-]")[1];
        System.out.println("beginTime:"+beginTime);
        System.out.println("endTime:"+endTime);

        String months="2020-08-05";
        String year = months.split("[-]")[0];
        String month = months.split("[-]")[1];
        String day = months.split("[-]")[2];
        System.out.println("year:"+year);
        System.out.println("month:"+month);
        System.out.println("day:"+day);





        }
}
